package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.ChannelTreeModel;

public class AddChannelEvent extends GwtEvent<AddChannelEventHandler> {

    public static Type<AddChannelEventHandler> TYPE = new Type<AddChannelEventHandler>();

    private final ChannelTreeModel channelTreeModel;

    public AddChannelEvent(ChannelTreeModel channelTreeModel) {
        this.channelTreeModel = channelTreeModel;
    }

    public ChannelTreeModel getChannelTreeModel() {
        return channelTreeModel;
    }

    @Override
    public Type<AddChannelEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(AddChannelEventHandler handler) {
        handler.onAddChannel(this);
    }

}
